<template>
    <el-dialog
      :title="dialogTitle"
      :visible.sync="isVisible"
      width="80%"
      @close="handleClose"
    >
      <iframe
        :src="iframeSrc"
        style="width: 100%; height: 400px; border: none;"
        frameborder="0"
      ></iframe>
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleClose">取消</el-button>
        <el-button type="primary" @click="handleConfirm">同意并跳转</el-button>
      </span>
    </el-dialog>
  </template>
  
  <script>
  export default {
    props: {
      isVisible: {
        type: Boolean,
        required: true
      },
      iframeSrc: {
        type: String,
        required: true
      },
      dialogTitle: {
        type: String,
        default: '隐私政策'
      }
    },
    methods: {
      handleClose() {
        this.$emit('update:isVisible', false);
      },
      handleConfirm() {
        this.$emit('confirm');
        this.handleClose();
      }
    }
  };
  </script>
  
  <style scoped>
  .dialog-footer {
    text-align: right;
  }
  </style>